#define _CRT_SECURE_NO_WARNINGS 1
#include"string.h"

void test_String1()
{
	String s("hello world");
	String s1(s);
	String s2;
	s2 = s1;
	String::iterator it = s.begin();
	while (it != s.end())
	{
		cout << *it << " ";
		++it;
	}
	cout << endl;
}

void test_String2()
{
	String s("hello world");
	s.push_back('x');
	s.push_back('x');
	s.push_back('x');
	s.append("hello world");

	s += 'x';
	s += "hello world";
}


void test_String3()
{
	String s("hello world");
	s.resize(5);
	s.resize(7,'x');
	s.resize(15, 'x');
	String s1("hello C++ hello C++ hello C++");
	s.swap(s1);


}

void test_String4()
{
	String s;
	cin >> s;
	cout << s;
}

void test_String5()
{
	String s("a");
	String s1("hello");

	cout << (s <= s1) << endl;
}

void test_String6()
{
	String s("hello world");
	//int n=s.find('o');
	//int n = s.find("xx");
	//s.insert(2, 'x');
	//cout << s << endl;
	//s.insert(2, "xxxxx");
	//cout << s << endl;
	String s1("This is an example sentence.");
	s1.erase(10, 8);
	cout << s1 << endl;

	String s2("hello world");
	s2.reserve(20);
	cout << s2.size() << endl;
	cout << s2.capacity() << endl;

}

void test_String7()
{
	String s("hello");
	//s.resize(10,'x');
	//cout << s << endl;
	//s += 'x';
	//s.insert(0, 'x');
	//s.insert(0, "hello");
	//s.insert(0, "");
	//cout << s << endl;
	//s.append(" world");
	//cout << s << endl;
	//cout << s.find("wo") << endl;
	//s.insert(0, "hello");
	//s.erase(5, 6);
	//cout << s << endl;
	//s.insert(0, "hello");
	//cout << s << endl;
	s.erase(2, 2);
	cout << s << endl;
}

void test_String8()
{
	String s;
	//cin >> s;
	getline(cin,s);
	cout << s << endl;
}

void test_String9()
{
	String s("hello world");
	String s1(s);
	String s2;
	s2 = s1;
}

int main()
{
	test_String9();
	return 0;
}